﻿using Abp.Domain.Entities.Auditing;
using FwProject.Authorization.Users;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace FwProject.ShoppingMall.EventAdvertising
{
    /// <summary>
    /// 用户优惠券
    /// </summary>
    [Table("shop_user_coupon")]
    public class ShopUserCoupon : FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        public long UserId { get; set; }

        /// <summary>
        /// 商城优惠券编号
        /// </summary>
        public Guid ShopCouponId { get; set; }
        [ForeignKey("ShopCouponId")]
        public virtual ShopCoupon ShopCoupon { get; set; }

        /// <summary>
        /// 默认0未使用1已使用， 优惠券使用状态
        /// </summary>
        public UseStatus UseStatus { get; set; } = UseStatus.Unused;

        /// <summary>
        /// 优惠券使用后对应的订单编号
        /// </summary>
        public string OrderNumber { get; set; }
    }

    public enum UseStatus
    {
        [Display(Name = "未使用")]
        Unused,
        [Display(Name = "已使用")]
        Used,
        [Display(Name = "删除优惠券")]
        Delete
    }
}
